<div class="span10 well">
	<?=$system_message;?>
	<fieldset>
	<legend>Department with employees and shifts</legend>
	<? if(!empty($departments)): ?>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>Department Name</th>
					<th>Department Description</th>
					<th colspan="2">Employees Assigned and shifts</th>
				</tr>
			</thead>
			<tbody>
				<?foreach($departments as $d):?>
				<tr>
					<td><?=$d->department_name;?></td>
					<td><?=$d->department_desc;?></td>
					<td>
					<?
					 $pos = $employees($d->id);
					 if(!empty($pos)):
					?>
						<ol>
						<?foreach($pos as $v):?>
							<li><?=ucwords($v->firstname);?></li>
						<?endforeach;?>
						</ol>
					<?else:?>
						<span class="label label-info">No Employees have been set</span>
					<?endif;?>
					</td>
					<td>
						<?if(!empty($pos)):?>
							<ul>
							<?foreach($pos as $v):?>
								<?if($v->shift == NULL):?>
									<li><span class="label label-important">UNASSIGNED</span></li>
								<?else:?>
									<li><?=ucwords($v->shift);?></li>
								<?endif;?>
							<?endforeach;?>
							</ul>
						<?endif;?>
					</td>
					<td>
					<a href="<?=site_url('departmentshiftsupdate/'.$d->id);?>" title="Update Department Shifts" class="btn btn-mini btn-success"><i class=" icon-pencil icon-white"></i></a>
					</td>
				</tr>
				<?endforeach;?>
			</tbody>
		</table>
		<?=$pagnate_links;?>
	<?else:?>
		<div class="alert alert-info">
			<h3>Notice!</h3>
			<p>No department(s) to show.</p>
		</div>
	<?endif;?>
	</fieldset>
</div>